<script type="text/javascript">
$(document).ready(function(){
		html_temp = $('#addnewimage').clone(true).html();
		
		$('#btnnewimage').live('click',function(){
			$("#addnewimage").append(html_temp);
			return false;
		});
	});
</script>
<div class="content-box">
	<div class="content-box-header">
		<h3>Add / Update</h3>
		<div class="clear"></div>
	</div> 
	<div class="content-box-content">
		<div class="">
			<form action="<?=base_url().'admincp/'.$module.'/save'?>" method="POST" enctype="multipart/form-data">
				<input type="hidden" value="<?=$id?>" name="hiddenId" />
				<fieldset>
					<p>
						<label>Status
						<input type="checkbox" name="status" <?php if(isset($result->status)){  if($result->status == 1) { print "checked='checked'"; } }else{ print "checked='checked'";}?>/></label>
					</p>
					<p>
						<label>Home
						<input type="checkbox" name="is_home" <?php if(isset($result->is_home)){  if($result->is_home == 1) { print "checked='checked'"; } }?>/></label>
					</p>
					<p> 
						<label>Album</label> 
						<select name="album_id" class="small-input" multiple="multiple" style="height: 200px;">
							<option value="0"></option>
							<?php 
							foreach($album_id AS $album)
							{
							?>
								<option value="<?=$album['id']?>" <?php if(isset($result->parent_id)){ if($result->parent_id == $album['id']){ echo "selected";} }?>><?=$album['name']?></option>
							<?php
							}
							?>
						</select>
						<br /><small>Tên của album</small>
					</p>
					<p>
						<label>Video link</label>
						<input class="text-input small-input" type="text" id="name-input" name="video_link" value="<?php if(isset($result->video_link)){ print $result->video_link; }else{ print ''; }?>"/> <span class="input-notification success png_bg">Successful message</span> <!-- Classes for input-notification: success, error, information, attention -->
						<br /><small>Link video</small>
					</p>
					<p id="addnewimage">
						<label>Image</label>
						<input type="file" name="image" id="image" class="text-input small-input"/> <span class="input-notification success png_bg">Successful message</span> <!-- Classes for input-notification: success, error, information, attention -->
						<br /><small>Add image</small>
					</p>
					<p>
						<input class="button" type="button" name="btnnewimage" id="btnnewimage" class="text-input small-input" value="Add new image"/>
					</p>
					<p>
						<input class="button" type="submit" value="Submit" />
						<!--<input class="button" type="submit" value="Save & close" />-->
					</p>
				</fieldset>
				<div class="clear"></div>
			</form>
		</div>  
	</div> 
</div> 